Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Nim v1.6.x, Nim v2.0.x, Nim v2.2.x #434

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Jul 17, 2024

A significant amount of upstream bugs and regressions have been fixed and backported related to statics, generics and templates which Constantine uses heavily.

This PR works around the last one that prevent Constantine from compiling on devel:

In summary the following cause a type mismatch:

func mulCheckSparse*(a: var QuadraticExt, b: static QuadraticExt) {.inline.} =

but the following works

template mulCheckSparse*(a: var QuadraticExt, b: QuadraticExt) =

However there were 2 template symbol generations issue:

In C, the symbol generated contains invalid backticks like t`gensym1234

Fortunately, another way to workaround this is to tag the variable as {.inject.} which makes the library supported in 1.6.x, 2.0.x and 2.2.x

@mratsim mratsim merged commit b718b7f into master Jul 17, 2024
24 checks passed
@mratsim mratsim deleted the nim-compat branch July 17, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant